package mcu.market.swing;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;

import java.awt.FlowLayout;

import javax.swing.JMenu;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
import javax.swing.SwingConstants;
import javax.swing.BoxLayout;

import java.awt.Component;

import javax.swing.ImageIcon;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class start_w extends JFrame {

	
	private JPanel contentPane;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper.launchBeautyEyeLNF();
					start_w frame = new start_w();
					new AppTool(frame);
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public start_w() {
		setBounds(100, 100, 580, 534);
		
		JMenuBar menuBar = new JMenuBar();
		setJMenuBar(menuBar);
		
		JMenu compute = new JMenu("整體分析");
		menuBar.add(compute);
		
		JMenuItem mntmRsi = new JMenuItem("RSI");
		mntmRsi.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				redrawMainPanel(new RSI_panel());
			}
		});
		compute.add(mntmRsi);
		
		JMenuItem mntmAvg = new JMenuItem("AVG");
		mntmAvg.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
			}
		});
		compute.add(mntmAvg);
		
		JMenu menu = new JMenu("我的投資");
		menuBar.add(menu);
		
		JMenu menu_1 = new JMenu("手中持股");
		menu.add(menu_1);
		
		JMenuItem menuItem_2 = new JMenuItem("今日股價");
		menu_1.add(menuItem_2);
		
		JMenuItem menuItem_3 = new JMenuItem("股價分析");
		menu_1.add(menuItem_3);
		
		JMenu qa = new JMenu("說明");
		menuBar.add(qa);
		
		JMenuItem menuItem = new JMenuItem("安裝說明");
		qa.add(menuItem);
		
		JMenuItem menuItem_1 = new JMenuItem("製作說明");
		qa.add(menuItem_1);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(new BorderLayout(0, 0));
		JPanel pl=new welcome_panel();
		contentPane.add(pl, BorderLayout.CENTER);
		
		//JLabel lblNewLabel = new JLabel("New label");
		//contentPane.add(lblNewLabel, BorderLayout.NORTH);
	}
	public void redrawMainPanel(Component comp){
		contentPane.removeAll();
		contentPane.add(comp, BorderLayout.CENTER);
		contentPane.validate();
	}

}
